<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
</head>
<body>
    <input type="text" value="2245788656">
    <input type="text" value="2245788656">
    <input type="button" value="添加">
    <script src="../lb/axios.min.js"></script>
    <script src="../config/config.js"></script>
    <script>
        let ipt=document.querySelectorAll("input");
        ipt[2].onclick=function(){
            axios.get(regApi,{
                params:{
                    username:ipt[0].value,
                    password:ipt[1].value
                }
            }).then(res=>{
                console.log(res)
                if(res.data.code==1){
                    alert(res.data.msg)
                    location.href="longin.html"
                }else{
                    alert("注册失败")
                }
            }).catch(error=>{
                console.log(error)
            })
        }
    </script>
</body>
</html>